/*customer.h*/
#ifndef CUSTOMER_H
#define CUSTOMER_H

#include "cineplex.h"

struct Customer{
	int index;
	int replyTo;
	
	int msgLock; /*use for data access as well*/
	int sleepCon;
	
	int myName;
	int repliesWaiting;
	int msgsToSend;
	int state;
	int numSubs, numPopcorn, numSoda;
	int myRow, myCol;
	int groupNumber;
	int subsInBR;
	
	/*array indices of first item*/
	int tickets;
	int popcorns;
	int sodas;
	
	int runScheduler;
	int money;
	int currentLine; /*should know what type from state*/
	int numMsgs;
	struct Message tempMsg;
	struct Message msgList[MAX_GROUP_SIZE + 1];
};

/*Seating algorithm vars*/
/*won't need separate locks since they're only used inside loop locked sections*/
	int OpenSeatsInRow[MAX_ROWS];
	int _seated;
	int startingSeat;
	int r, c;
	int numTakenInRow;
	int seatsAssigned;

void Customer_Scheduler(int index);
struct Message Customer_GetMessage(int index, int name);

/*LEADER ACTIONS*/
void Customer_JoinTixLine(int index);
void Customer_WaitTixLine(int index);
void Customer_CheckNewTixLine(int index);
void Customer_RecTixClerk(int index);
void Customer_TixOrderPlaced(int index);
void Customer_TixPaySent(int index);
void Customer_AskSubsFood(int index);
void Customer_WaitSubFood(int index);
void Customer_JoinFoodLine(int index);
void Customer_WaitFoodLine(int index);
void Customer_CheckNewFoodLine(int index);
void Customer_RecFoodClerk(int index);
void Customer_PopcornOrderPlaced(int index);
void Customer_DrinkOrderPlaced(int index);
void Customer_FoodPaySent(int index);
void Customer_JoinEntryLine(int index);
void Customer_WaitEntryLine(int index);
void Customer_CheckNewEntryLine(int index);
void Customer_RecTixTaker(int index);
void Customer_GaveTix(int index);
void Customer_TellSubsGoIn(int index);
void Customer_LeadGoIn(int index);
void Customer_WatchingMovie(int index);
void Customer_LeadRegroup(int index);
void Customer_AskUseBR(int index);
void Customer_FindOutBR(int index);
void Customer_WaitBR(int index);
void Customer_LeaveCineplex(int index);
void Customer_GoToLobby(int index);
void Customer_InLobby(int index);
void Customer_RecSizeRequest(int index);
/*SUB ACTIONS*/
void Customer_sNewSub(int index);
void Customer_sSendFoodOrder(int index);
void Customer_sFoodOrderSent(int index);
void Customer_sRecGoIn(int index);
void Customer_sWaitForSeat(int index);
void Customer_sWatchingMovie(int index);
void Customer_sRegroup(int index);
void Customer_sLeaveTheater(int index);
void Customer_sAskedBR(int index);
void Customer_sUseBR(int index);
void Customer_sWaitBR(int index);
void Customer_sLeaveCineplex(int index);

#endif